import 'dart:convert';

import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/get_permission_info_entity.g.dart';

export 'package:safetymonitor/generated/json/get_permission_info_entity.g.dart';

@JsonSerializable()
class GetPermissionInfoEntity {

	GetPermissionInfoEntity();

	factory GetPermissionInfoEntity.fromJson(Map<String, dynamic> json) => $GetPermissionInfoEntityFromJson(json);
	GetPermissionInfoUser? user;
	List<String>? roles = [];
	List<GetPermissionInfoMenus>? menus = [];

	Map<String, dynamic> toJson() => $GetPermissionInfoEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GetPermissionInfoUser {

	GetPermissionInfoUser();

	factory GetPermissionInfoUser.fromJson(Map<String, dynamic> json) => $GetPermissionInfoUserFromJson(json);
	int? id = 0;
	String? nickname = '';
	String? avatar = '';
	int? deptId = 0;

	Map<String, dynamic> toJson() => $GetPermissionInfoUserToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GetPermissionInfoMenus {

	GetPermissionInfoMenus();

	factory GetPermissionInfoMenus.fromJson(Map<String, dynamic> json) => $GetPermissionInfoMenusFromJson(json);
	int? id = 0;
	int? parentId = 0;
	String? name = '';
	String? path = '';
	String? component = '';
	String? componentName = '';
	String? icon = '';
	bool? visible = false;
	bool? keepAlive = false;
	bool? alwaysShow = false;
	List<GetPermissionInfoMenusChildren>? children = [];

	Map<String, dynamic> toJson() => $GetPermissionInfoMenusToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GetPermissionInfoMenusChildren {

	GetPermissionInfoMenusChildren();

	factory GetPermissionInfoMenusChildren.fromJson(Map<String, dynamic> json) => $GetPermissionInfoMenusChildrenFromJson(json);
	int? id = 0;
	int? parentId = 0;
	String? name = '';
	String? path = '';
	String? component = '';
	String? componentName = '';
	String? icon = '';
	bool? visible = false;
	bool? keepAlive = false;
	bool? alwaysShow = false;
	dynamic children;

	Map<String, dynamic> toJson() => $GetPermissionInfoMenusChildrenToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}